<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
        <%@include file="include.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>所有文件</title>
<script src="js/metroui/js/jquery.dataTables.min.js"></script>
</head>
<body>
<button id="dl" class="button primary loading-pulse">下载所有</button>


<table class="table striped hovered dataTable border bordered" id="dataTables-1" style="width:100%;">
                <thead>
                <tr>
                    <th class="text-left">Fileid</th>
                    <th class="text-left">Filename</th>
					<th class="text-left">Uploadtime</th>
					
                </tr>
                </thead>

                <tbody>
                </tbody>
            </table>


<script type="text/javascript">
$(document).ready(function(){
	$("#dl").click(function(){
		//alert("hh");
		 window.location.href=encodeURI("downloadall.action");
	});
	
	
	$('#dataTables-1').DataTable( {
        "ajax": "listalluserfile.action",
        "columns": [
            { "data": "fileid" },
            { "data": "filename" },
            {data:"uploadtime.time",render:function(data){
        		
        		return UnixToDate(data);
        	}}
        ]
    } );
	
	
	
});


function UnixToDate(unixTime) {
    var date=new Date(unixTime);
    Y = date.getFullYear() + '-';
    M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
    D = date.getDate() + ' ';
    h = date.getHours() + ':';
    m = date.getMinutes() + ':';
    s = date.getSeconds(); 
	
    return Y+M+D+h+m+s;
}
</script>
</body>
</html>